<template>
  <div>
    <div class="title">热销推荐</div>
    <ul>
      <router-link tag="li" :to="'/detail/' + item.id" v-for="item in recommendList" :key="item.id">
        <div class="wrapper">
          <img class="img-content"  :src="item.imgUrl" alt="">
          <div class="info-wrapper">
            <p class="info-title" v-text="item.title"></p>
            <p class="info-desc" v-text="item.desc"></p>
            <button class="item-button">
              查看详情
            </button>
          </div>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendList: Array
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/varibles.styl'
  .title
    line-height: .8rem
    background: #eee
    text-indent: .2rem
    margin-top: .1rem
  .wrapper
    display: flex
    height: 1.9rem
    overflow: hidden
    .img-content
      width: 1.7rem
      height: 1.7rem
      padding: .1rem
    .info-wrapper
      flex: 1
      padding: .1rem
      min-width: 0
      .info-title
        line-height: .54rem
        font-size: .32rem
        ellipsis()
      .info-desc
        line-height: .4rem
        color: #ccc
        ellipsis()
      .item-button
        line-height: .44rem
        background: #ff9300
        padding: 0 .16rem
        -webkit-border-radius: .06rem
        -moz-border-radius: .06rem
        border-radius: .06rem
        color: #fff
</style>
